<template>
  <div>
    <!-- <MHeader>我的课程</MHeader>  -->
    <div class="content">
      <h3>
        <i class="iconfont icon-liebiao" ></i> 已购买
      </h3>
      <CourseList :list="orderList" ></CourseList>
      <h3>
        <i class="iconfont icon-liebiao"></i> 已收藏
      </h3>
      <CourseList :list="collectList" ></CourseList>
    </div>
  </div>
</template>

<script>
import MHeader from "@/components/MHeader.vue";
import CourseList from "@/components/CourseList.vue";
import * as types from "../store/types";
import { mapState, mapGetters } from "vuex";
export default {
  components: {
    MHeader,
    CourseList
  },
  created() {
    this.$store.dispatch("account/" + [types.GET_COLLECTS]);
    this.$store.dispatch("course/" + [types.GET_COURSE_ORDER_LIST]);
  },
  computed: {
    ...mapState("account", ["collectList"]),
    ...mapGetters("course", ["orderList"])
  }
};
</script>

<style lang="less" scoped>
.content {
  h3 {
    font-size: 16px;
    line-height: 32px;
  }
  padding-bottom: 20px;
}
</style>